home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / haeberli / impression / ssrender.c < prev    next >
C/C++ Source or Header  |  1994-08-01  |  2KB  |  82 lines

  1. /*
  2.  * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. /*
  18.  *    ssrender - 
  19.  *        Render a sample set on the screen.
  20.  *
  21.  *            Paul Haeberli - 1988
  22.  *
  23.  */
  24. #include "stdio.h"
  25. #include "gl.h"
  26. #include "device.h"
  27. #include "ss.h"
  28. #include "math.h"
  29. #include "image.h"
  30. #include "glmode.h"
  31.  
  32. #define TILESIZE    1000
  33.  
  34. sampleset *ss;
  35.  
  36. drawit()
  37. {
  38.     srand(43);
  39.     grey(0.5);
  40.     clear();
  41.     zclear();
  42.     zbuffer(1);
  43.     srand(43);
  44. #ifdef WRAP
  45.     wrapssdraw(ss);
  46. #else
  47.     ssdraw(ss);
  48. #endif
  49. }
  50.  
  51. main(argc,argv)
  52. int argc;
  53. char **argv;
  54. {
  55.     int xsize, ysize;
  56.     int xdraw, ydraw;
  57.  
  58.     if( argc<5 ) {
  59.     fprintf(stderr,"usage: ssrender inss outimage xsize ysize [style]\n");
  60.     exit(1);
  61.     } 
  62.     xsize = atoi(argv[3]);
  63.     ysize = atoi(argv[4]);
  64.     if(xsize<=TILESIZE && ysize<=TILESIZE) {
  65.         xdraw = xsize;
  66.         ydraw = ysize;
  67.     } else {
  68.     xdraw = TILESIZE;
  69.     ydraw = TILESIZE;
  70.     }
  71.     prefposition(10,10+xdraw-1,10,10+ydraw-1);
  72.     foreground();
  73.     winopen("ssrender");
  74.     RGBmode();
  75.     gconfig(); 
  76.     glsetmode(RGB,1);
  77.     ss = ssfromfile(argv[1]);
  78.     ssconesides(500);
  79.     ssortho(xsize,ysize);
  80.     rendertofile(drawit,argv[2],xsize,ysize);
  81. }
  82.